﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MGlobal : NState<BattleEntityHero>
{
    public void Enter(BattleEntityHero entity, params object[] args)
    {
        
    }

    public void Execute(BattleEntityHero entity, params object[] args)
    {
        
    }

    public void Exit(BattleEntityHero entity, params object[] args)
    {
        
    }

    public bool OnMessage(BattleEntityHero entity, MessageBody message)
    {
        if(message.msgId == MessageId.BulletArrive)
        {
            entity.DelChild(message.senderId);
            EntityMessageDispatcher.Instance.SendEntity2Node(message.msgId, entity.Id, message.args);
            return true;
        }
        return false;
    }
}
